#coding:utf-8
import pygtk
pygtk.require('2.0')
import gtk
import gtk.glade

class MyWindow:
    def __init__(self):
        res = gtk.glade.XML('./res.glade')
        window = res.get_widget('window')
        signal = {'OnQuit':self.OnQuit}
        res.signal_autoconnect(signal)
        window.connect('destroy', lambda q:gtk.main_quit())
        window.show()

    def OnQuit(self, widget):
        gtk.main_quit()

    def main(self):
        gtk.main()

if __name__ == '__main__':
    w = MyWindow()
    w.main()
